//获取应用实例
const app = getApp()

Page({
	data: {
		coupons:''
	},

	onLoad: function({couponSn}) {
		this.initCouponDetails(couponSn);
	},
	
	initCouponDetails(couponSn) {
		const {userId=''} = wx.getStorageSync('userInfo');
		const that = this;
		if(userId) {
			wx.request({
				url:'https://pms.uxon.net/api/miniapp/coupon/findByCouponSn',
				data:{
				    couponSn
				},
				success:function(res) {
					console.log(res.data.data)
					that.setData({
						coupons:res.data.data
					})
				}
			})
		}
	},
	
	onJump() {
		wx.navigateToMiniProgram({
			appId: "wx90ed8918c4766d32",
			path: "pages/index/index",
			extraData: {
			  //   foo: 'bar'
			},
			envVersion: "develop",
			success(res) {
			  // 打开成功
			},
		});
	},
	
})
